<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <script language="JavaScript" type="text/javascript">
        <!--
        dmxListToTree({
          bullets : 'plusminus',
          icons   : true,
          struct  : false,
          objId   : 'FolderView'
        });
        //-->
        </script>
    </head>
    <body>
        <?php
            function ListFolder($path)
            {
                //using the opendir function
                $dir_handle = @opendir($path) or die("Unable to open $path");

                //Leave only the lastest folder name
                $dirname = end(explode("/", $path));

                //display the target folder.
                echo ("<li>$dirname\n");
                echo "<ul>\n";
                while (false !== ($file = readdir($dir_handle)))
                {
                    if($file!="." && $file!="..")
                    {
                        if (is_dir($path."/".$file))
                        {
                            //Display a list of sub folders.
                            ListFolder($path."/".$file);
                        }
                        else
                        {
                            //Display a list of files.
                            echo "<li>$file</li>";
                        }
                    }
                }
                echo "</ul>\n";
                echo "</li>\n";

                //closing the directory
                closedir($dir_handle);
            }
        ?>
        <ul class="dmxtree" id="FolderView">
        <?php ListFolder("C://"); ?>
        </ul>
    </body>
</html>
